package com.sluggard.security.manage.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sluggard.mp.model.req.BaseReq;
import com.sluggard.security.manage.mapper.DictTypeMapper;
import com.sluggard.security.manage.model.entity.DictDataEntity;
import com.sluggard.security.manage.model.entity.DictTypeEntity;
import com.sluggard.security.manage.model.req.ChangeStatusReq;
import com.sluggard.security.manage.service.IDictTypeService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 字典类型表 服务实现类
 * </p>
 *
 * @author lizheng
 * @since 2024-05-07
 */
@Service
public class DictTypeServiceImpl extends ServiceImpl<DictTypeMapper, DictTypeEntity> implements IDictTypeService {

    @Override
    public List<DictTypeEntity> onList(QueryWrapper<DictTypeEntity> queryWrapper) {
        return baseMapper.selectListWithData(queryWrapper);
    }

    @Override
    public DictTypeEntity show(BaseReq req) {
        return baseMapper.selectWithData(req.getId());
    }

    @Override
    public void onTables(QueryWrapper<DictTypeEntity> chainWrapper, Page<DictTypeEntity> page) {
        baseMapper.selectWithDataPage(page, chainWrapper);
    }

    @Override
    public void changeStatus(ChangeStatusReq req) {
        baseMapper.changeStatus(req);
    }
}
